/*  
* Copyright (c) 2010, James Daniello
* This project is licensed under the 'New BSD' license.
* The full text of the license can be found in the root
* directory under the filename "LICENSE.
"
*/

package src.objects;

import java.util.Vector;

/**
* This is the super class for all game objects which are also Selectable, Collidable, and Damagable.
* This is where the name PICAIUGameObject_SCD comes from. SCD stands for the three above-mentioned
* attributes. Extending this class, rather than PICAIUGameObject automatically grants any sub class
* the standard methods and fields for collisions, selections, and damage bounds.
*/
public abstract class PICAIUGameObject_SCD extends PICAIUGameObject implements PICAIUCollidable, PICAIUSelectable, PICAIUDamagable{

  protected Vector<PICAIUBounds> collisionBounds = new Vector<PICAIUBounds>();
  protected Vector<PICAIUBounds> selectionBounds = new Vector<PICAIUBounds>();
  protected Vector<PICAIUBounds> damageBounds = new Vector<PICAIUBounds>();
  
  
  public PICAIUGameObject_SCD(){
  }
  
  /** Returns if this object can be selected with a mouse
  */
  @Override
  public boolean isSelectable(){
    boolean anySelectable = false;
    for(PICAIUBounds bounds: selectionBounds){
      if(bounds.isActive()){
        anySelectable = true;
        break;
      }
    }
    return selectable&&anySelectable;
  } 
  
  /**
  * Returns the specific selection bounds for this object
  */
  @Override
  public Vector<PICAIUBounds> getSelectionBounds(){
    return selectionBounds;
  }
  
  /**
  * Returns the specific collision bounds for this object
  */
  @Override
  public Vector<PICAIUBounds> getCollisionBounds(){
    return collisionBounds;
  }
  
  /**
  * Returns the specific selection bounds for this object
  */
  @Override
  public Vector<PICAIUBounds> getDamageBounds(){
    return damageBounds;
  }
  
}